﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DACNPM.MyUserControl.UCMenu;
using BLL;
using DACNPM;

namespace DACNPM.MyUserControl.UCHienThi
{
    public partial class UCDanhSachChucNang : UserControl
    {
        String idnhanvien;

        public UCDanhSachChucNang(String idtoancuc)
        {
            InitializeComponent();
            this.idnhanvien = idtoancuc;
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            UCDanhSachNV ucDSNV = new UCDanhSachNV();
            UCChucNangNhanVien ucCNNV = new UCChucNangNhanVien(idnhanvien);

            Form form = this.ParentForm;

            ControlAccess.ShowConTrol(form, ucDSNV, "grbHienThiChucNang");
            ControlAccess.ShowConTrol(form, ucCNNV, "grbMenu");
        }

        private void pictureBox2_Click(object sender, EventArgs e)
        {
            UCDanhSachKH ucDSKH = new UCDanhSachKH();
            UCChucNangKhachHang ucCNKH = new UCChucNangKhachHang(idnhanvien);

            Form form = this.ParentForm;

            ControlAccess.ShowConTrol(form, ucDSKH, "grbHienThiChucNang");
            ControlAccess.ShowConTrol(form, ucCNKH, "grbMenu");
        }

        private void ptbHangHoa_Click(object sender, EventArgs e)
        {
            UCDanhSachHang ucDSHang = new UCDanhSachHang();
            UCChucNangHangHoa ucCNHang = new UCChucNangHangHoa(idnhanvien);

            Form form = this.ParentForm;

            ControlAccess.ShowConTrol(form, ucDSHang, "grbHienThiChucNang");
            ControlAccess.ShowConTrol(form, ucCNHang, "grbMenu");
        }

        private void ptbDatHang_Click(object sender, EventArgs e)
        {
            UCDanhSachDDH ucDSDDH = new UCDanhSachDDH(idnhanvien);
            UCChucNangDDH ucCNDDH = new UCChucNangDDH(idnhanvien);

            Form form = this.ParentForm;

            ControlAccess.ShowConTrol(form, ucDSDDH, "grbHienThiChucNang");
            ControlAccess.ShowConTrol(form, ucCNDDH, "grbMenu");
        }

        private void ptbBanHang_Click(object sender, EventArgs e)
        {
            UCDanhSachHoaDonBan ucDSHDB = new UCDanhSachHoaDonBan(idnhanvien);
            UCChucNangHoaDonBan ucCNHDB = new UCChucNangHoaDonBan(idnhanvien);

            Form form = this.ParentForm;

            ControlAccess.ShowConTrol(form, ucDSHDB, "grbHienThiChucNang");
            ControlAccess.ShowConTrol(form, ucCNHDB, "grbMenu");
        }

        private void ptbNhapHang_Click(object sender, EventArgs e)
        {
            UCDanhSachHoaDonNhapHang ucDSHDN = new UCDanhSachHoaDonNhapHang(idnhanvien);
            UCChucNangHDNhap ucCNHDN = new UCChucNangHDNhap(idnhanvien);

            Form form = this.ParentForm;

            ControlAccess.ShowConTrol(form, ucDSHDN, "grbHienThiChucNang");
            ControlAccess.ShowConTrol(form, ucCNHDN, "grbMenu");
        }

        private void ptbNhaCungCap_Click(object sender, EventArgs e)
        {
            UCDanhSachNCC ucDSNCC = new UCDanhSachNCC();
            UCChucNangNCC ucCNNCC = new UCChucNangNCC(idnhanvien);

            Form form = this.ParentForm;

            ControlAccess.ShowConTrol(form, ucDSNCC, "grbHienThiChucNang");
            ControlAccess.ShowConTrol(form, ucCNNCC, "grbMenu");
        }

        private void ptbThongKe_Click(object sender, EventArgs e)
        {
            UCChucNangThongKe ucCNTK = new UCChucNangThongKe(idnhanvien);
            UCThongKeDoanhThu ucTKDT = new UCThongKeDoanhThu();

            Form form = this.ParentForm;

            ControlAccess.ShowConTrol(form, ucTKDT, "grbHienThiChucNang");
            ControlAccess.ShowConTrol(form, ucCNTK, "grbMenu");
        }
    }
}
